//导入axios
import Vue from 'vue'
import axios from 'axios'
import VueAxios from 'vue-axios'

Vue.use(VueAxios, axios)

//创建instance
const instance = axios.create({
    baseURL: 'http://toutiao.itheima.net',
    timeout: 1000,
  });


  //封装接口
  function userLogin(mobile,code){
      return instance({
        url:'/v1_0/authorizations',
        method: 'post',
        data: {
            mobile,
            code
        }
    })
  }

  //导出接口
  export {userLogin}